﻿using System.Web.Mvc;
using System.Web.Routing;

namespace EpiInfoCloudMagpiBridge
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            //);

            //routes.MapRoute(
            //    "Default",
            //    "{controller}/{action}/{id}",
            //    new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            //    new[] { "EpiInfoCloudMagpiBridge.Controllers" }
            //);    


            routes.MapRoute(
                  "Default",
                  "{controller}/{action}/{id}",
                  new { controller = "Login", action = "Index", id = UrlParameter.Optional },
                  new[] { "EpiInfoCloudMagpiBridge.Controllers" }
             );

            routes.MapRoute(
                name: "",
                url: "{controller}/{action}",
                defaults: new { controller = "DownloadResponse", action = "Index" }
                );


            routes.MapRoute(
              name: "",
              url: "{controller}/{action}/{id} ",
              defaults: new { controller = "AzureMobileServiceSettings", action = "Edit" }
                );


            routes.MapRoute(
                name: "",
                url: "{controller}/{action}",
                defaults: new { controller = "AzureMobileServices", action = "Index" }
            );


            routes.MapRoute(
              name: "",
              url: "{controller}/{action}",
              defaults: new { controller = "MagpiAccountSettings", action = "Index" }
        );


            routes.MapRoute(
              name: "",
              url: "{controller}/{action} ",
              defaults: new { controller = "MagpiAzureMapping", action = "Edit" }
        );

        }
    }
}